package com.lwj.hiring.company.dao;

import java.util.List;

import com.lwj.hiring.common.util.DBUtil;
import com.lwj.hiring.company.entity.Company;

/**
 * CompanyDao
 * 
 * @author Administrator
 *
 */
public class CompanyDao {

	/**
	 * 企业登录
	 * 
	 * @param code
	 * @param password
	 * @return
	 */
	public Company login(String code, String password) {
		String sql = "SELECT id,name FROM company WHERE code=? AND password=? LIMIT 1";
		return DBUtil.getUniqueResult(Company.class, sql, code, password);
	}

	/**
	 * 企业注册
	 * 
	 * @param list
	 * @return
	 */
	public int add(List<Object> list) {
		String sql = "INSERT INTO company values(NUll,?,?,?,?,?,?,?,?,?)";
		return DBUtil.executeUpdate(sql, list);
	}

}
